# -*- coding:utf-8 -*-
from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import mouseAndKeyboardConstants

class MouseAndKeyboardSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(MouseAndKeyboardSubDirectiveTree, self).__init__(parent)
        self.createMouseAndKeyboardSubTreeNode()

    def createMouseAndKeyboardSubTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "mouseAndKeyboard"
        self.setText(0, "鼠标键盘")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.keyboardInputDirective, "键盘输入")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.mouseClickDirective, "鼠标点击")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.movingMouseDirective, "移动鼠标")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.gettingMousePositionDirective, "获取鼠标当前位置")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.scrollingMouseWheelDirective, "滚动鼠标滚轮")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.clickingOnImageDirective, "点击图像")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.mouseHoveringOverImageDirective, "鼠标悬停在图像上")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.clickingOnOCRTextDirective, "点击文本(OCR)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.mouseHoveringOverOCRTextDirective, "鼠标悬停在文本上(OCR)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.startingImitatingHumanBehaviorDirective, "开启模拟真人操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, mouseAndKeyboardConstants.MouseAndKeyboardConstants.stoppingImitatingHumanBehaviorDirective, "停止模拟真人操作")